/*
 * @FilePath: \undefinedc:\Users\sxjct\.leetcode\190.颠倒二进制位.cpp
 * @Brief: 
 * @Version: 1.0
 * @Date: 2021-03-29 09:58:13
 * @Author: tianyiyi
 * @Copyright: Copyright@tianyiyi
 * @LastEditors: Mr.Tian
 * @LastEditTime: 2021-03-29 10:06:48
 */
/*
 * @lc app=leetcode.cn id=190 lang=cpp
 *
 * [190] 颠倒二进制位
 */

// @lc code=start
class Solution {
public:
    uint32_t reverseBits(uint32_t n) {
        int num = 32;
        uint32_t res = 0;
        while(num--)
        {
            res <<= 1; 
            res += n&1;
            n>>=1;

        }
        return res;
    }
};
// @lc code=end

